package com.softserveinc.interactive_board.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("administration/templates")
public class AdminTemplatesController {

	private static final int USERS_AND_PRES_ID = 1;

	private static final String EMPTYUSERS_AND_PRES_FILE_LOCATION = "administration/templates/empty";
	private static final String USERS_AND_PRES_FILE_LOCATION = "administration/templates/us_and_pres";

	@RequestMapping(method = RequestMethod.GET)
	public String def() {
		return AdminTemplatesController.EMPTYUSERS_AND_PRES_FILE_LOCATION;
	}

	@RequestMapping("/template")
	public String index(@RequestParam("id") int id) {
		switch (id) {
		case (AdminTemplatesController.USERS_AND_PRES_ID): {
			return AdminTemplatesController.USERS_AND_PRES_FILE_LOCATION;
		}
		default:
			return AdminTemplatesController.EMPTYUSERS_AND_PRES_FILE_LOCATION;
		}
	}

}
